package com.pheruagor.handmanager.controller {
    import com.pheruagor.handmanager.view.StartingPopupMediator;
    import com.pheruagor.handmanager.view.component.StartingPopUp;

    import flash.display.DisplayObject;

    import mx.managers.PopUpManager;

    import org.puremvc.as3.interfaces.INotification;
    import org.puremvc.as3.patterns.command.SimpleCommand;

    public class OpenStartingPopUpCommand extends SimpleCommand {
        public static const NAME:String = "openStartingPopUpCommand";
        public static const EXECUTED:String = NAME + "Executed";

        override public function execute(notification:INotification):void {
            var popupContainer:DisplayObject = DisplayObject(notification.getBody());
            var popup:StartingPopUp = new StartingPopUp();
            facade.registerMediator(new StartingPopupMediator(popup));
            PopUpManager.addPopUp(popup, popupContainer, true);
            PopUpManager.centerPopUp(popup);
            sendNotification(EXECUTED);
        }
    }
}